//
//  LJMBase_Model.m
//  wind
//
//  Created by 李金明 on 16/1/9.
//  Copyright © 2016年 李金明. All rights reserved.
//

#import "LJMBase_Model.h"

@implementation LJMBase_Model
- (void)dealloc
{
    [_mId release];
    [super dealloc];
}
- (instancetype)initWithDic:(NSMutableDictionary *)dic
{
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:dic];
    }
    return self;
    
}
+ (instancetype)baseModelWithDic:(NSMutableDictionary *)dic
{
    id object = [[[self class] alloc] initWithDic:dic];
    return [object autorelease];
}



+ (NSMutableArray *)baseModelWithArr:(NSMutableArray *)array
{
    NSMutableArray *arr = [NSMutableArray array];
    for (NSMutableDictionary *dic in array) {
        
        @autoreleasepool {
            id model = [[self class] baseModelWithDic:dic];
            [arr addObject:model];
        }
    }
    return arr;
}

//KVC容错
- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    
    if ([key isEqualToString:@"id"]) {
        self.mId = value;
    }
    
}


@end
